import request from '@/utils/request'

// 查询通道列表
export function channelList(query) {
  return request({
    url: '/manage/uniChannel/list',
    method: 'get',
    params: query
  })
}
// 通道新增
export function channelAdd(data) {
  return request({
    url: '/manage/uniChannel/add',
    method: 'post',
    data
  })
}
// 通道修改
export function channelUpdate(data) {
  return request({
    url: '/manage/uniChannel/update',
    method: 'post',
    data
  })
}

// 设置可用商户
export function setMerchantRate(data) {
  return request({
    url: '/manage/uniChannel/setMerchantRate',
    method: 'post',
    data
  })
}

// 删除商户
export function deleteMerchantRate(data) {
  return request({
    url: '/manage/uniChannel/deleteMerchantRate',
    method: 'post',
    data
  })
}
// 账户列表

export function accountList(query) {
  return request({
    url: '/manage/upiAccount/list',
    method: 'get',
    params: query
  })
}
// 设置通道upi账户
export function setUpiList(data) {
  return request({
    url: '/manage/uniChannel/setUpiAccountConfig',
    method: 'post',
    data
  })
}
// 已设置的账户

export function getUpiList(data) {
  return request({
    url: '/manage/uniChannel/getUpiAccountConfig',
    method: 'post',
    data
  })
}
// 时间段内代收、代付统计

export function statisticsAll(data) {
  return request({
    url: '/public/statistic_balance/between_date',
    method: 'post',
    data
  })
}
// 通道成功率
export function successAll(data) {
  return request({
    url: '/public/statistic_channel_rate/between_date',
    method: 'post',
    data
  })
}